package com.sdk.sdkdemo;

import android.app.ActivityManager;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.os.Handler;
import android.os.Process;
import android.provider.Settings;
import android.util.Log;

import com.google.gson.JsonObject;
import com.sdk.util.CommonUtils;
import com.sdk.util.FileUtils;
import com.sdk.util.LogUtils;

import org.json.JSONObject;

import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpCookie;
import java.net.HttpURLConnection;
import java.net.ServerSocket;
import java.net.URL;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

import javax.xml.xpath.XPath;

import dalvik.system.DexClassLoader;
import de.robv.android.xposed.IXposedHookLoadPackage;
import de.robv.android.xposed.XC_MethodHook;
import de.robv.android.xposed.XposedHelpers;
import de.robv.android.xposed.callbacks.XC_LoadPackage;


public class SdkXposed implements IXposedHookLoadPackage {
    private static String Tag = "SdkXposed";
//    private boolean mIsHooked = false;
//    private Activity mMainActivity;
    private Context mContext;
    private ClassLoader mClassLoader;


    @Override
    public void handleLoadPackage(final XC_LoadPackage.LoadPackageParam loadPackageParam) throws Throwable {
//        if(loadPackageParam.packageName.equals("cn.TuHu.android")){
//            XposedHelpers.findAndHookMethod(loadPackageParam.classLoader.loadClass("cn.TuHu.ui.ScreenManager"),
//                    "onCreate", new XC_MethodHook() {
//                        @Override
//                        protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
//                            mContext = (Context) param.thisObject;
//                            mClassLoader = mContext.getClassLoader();
//
//                            LogUtils.d(Tag, "aaaaaaaaaaaa");
////                            hookForTest(mClassLoader);
////                            if(isMainProcess(mContext, "cn.TuHu.android")){
////                                hookForTest(mClassLoader);
////                            }
//                        }
//                    });
//        }
//
//        if(loadPackageParam.packageName.equals("com.cmcm.uangme")){
//            XposedHelpers.findAndHookMethod(loadPackageParam.classLoader.loadClass("com.cmcm.uangme.MainApplication"),
//                    "onCreate", new XC_MethodHook() {
//                        @Override
//                        protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
//                            LogUtils.d(Tag, "start hook For crasheye");
//                            Context context = (Context)param.thisObject;
//                            ClassLoader classLoader = context.getClassLoader();
//                            hookForCrashEye(classLoader);
//                            hookForMain(classLoader);
//                            hookForFile(classLoader);
//                        }
//                    });
//        }

//        if(loadPackageParam.packageName.equals("com.publisher.sample")){
//            XposedHelpers.findAndHookMethod(loadPackageParam.classLoader.loadClass("com.publisher.sample.MainActivity"),
//                    "onCreate", Bundle.class, new XC_MethodHook() {
//                        @Override
//                        protected void afterHookedMethod(MethodHookParam param) throws Throwable {
//                            LogUtils.d(Tag, "hook com.publisher.sample");
//                            Context context = (Context)param.thisObject;
//                            ClassLoader classLoader = context.getClassLoader();
//                            hookForVungleNetwork(classLoader);
//                        }
//                    });
//        }

//        if(loadPackageParam.packageName.equals("com.tencent.bugly.demo")){
//            XposedHelpers.findAndHookMethod(loadPackageParam.classLoader.loadClass("com.tencent.bugly.demo.MyApplication"), "onCreate", new XC_MethodHook() {
//                @Override
//                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
//                    LogUtils.d(Tag, "hook com.tencent.bugly.demo");
//                    Context context = (Context) param.thisObject;
//                    ClassLoader classLoader = context.getClassLoader();
//                    hookForBuglyNetwork(classLoader);
//                }
//            });
//        }

//        if(loadPackageParam.packageName.equals("com.my.targetDemoApp")){
//            XposedHelpers.findAndHookMethod(loadPackageParam.classLoader.loadClass("com.my.targetDemoApp.MainActivity"), "onCreate",
//                    Bundle.class, new XC_MethodHook() {
//                @Override
//                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
//                    LogUtils.d(Tag, "hook com.my.targetDemoApp");
//                    Context context = (Context) param.thisObject;
//                    ClassLoader classLoader = context.getClassLoader();
//                    hookForMyTarget(classLoader);
//                }
//            });
//        }

//        if(loadPackageParam.packageName.equals("com.ksmobile.cb")){
//            XposedHelpers.findAndHookMethod(loadPackageParam.classLoader.loadClass("com.ijinshan.browser.KApplication"), "onCreate",  new XC_MethodHook() {
//                @Override
//                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
//                    LogUtils.d(Tag, "hook com.my.targetDemoApp");
//                    Context context = (Context) param.thisObject;
//                    ClassLoader classLoader = context.getClassLoader();
//                    hookForAppWall(classLoader);
//                }
//            });
//        }

//
//        if(loadPackageParam.packageName.equals("com.cleanmaster.mguard")){
//            XposedHelpers.findAndHookMethod(loadPackageParam.classLoader.loadClass("com.keniu.security.MainEntry"), "onCreate",  new XC_MethodHook() {
//                @Override
//                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
//                    LogUtils.d(Tag, "hook com.cleanmaster.mguard");
//                    Context context = (Context) param.thisObject;
//                    ClassLoader classLoader = context.getClassLoader();
//                    hookFlurry(classLoader);
//                    LogUtils.d(Tag, "version: " + XposedHelpers.callStaticMethod(classLoader.loadClass("com.flurry.android.FlurryAgent"),
//                            "getReleaseVersion"));
//                    LogUtils.d(Tag, "agentVersion: " + XposedHelpers.callStaticMethod(classLoader.loadClass("com.flurry.android.FlurryAgent"),
//                            "getAgentVersion"));
//                }
//            });
//        }

//        if(loadPackageParam.packageName.equals("com.sdk.flurrysdkdemo")){
//            XposedHelpers.findAndHookMethod(loadPackageParam.classLoader.loadClass("com.sdk.flurrysdkdemo.MyApplication"), "onCreate",  new XC_MethodHook() {
//                @Override
//                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
//                    LogUtils.d(Tag, "hook com.sdk.flurrysdkdemo");
//                    Context context = (Context) param.thisObject;
//                    ClassLoader classLoader = context.getClassLoader();
//                    hookFlurry(classLoader);
//                    LogUtils.d(Tag, "version: " + XposedHelpers.callStaticMethod(classLoader.loadClass("com.flurry.android.FlurryAgent"),
//                            "getReleaseVersion"));
//                    LogUtils.d(Tag, "agentVersion: " + XposedHelpers.callStaticMethod(classLoader.loadClass("com.flurry.android.FlurryAgent"),
//                            "getAgentVersion"));
//                }
//            });
//        }

//        if(loadPackageParam.packageName.equals("com.turbochilli.rollingsky")){
//            XposedHelpers.findAndHookMethod(loadPackageParam.classLoader.loadClass("com.turbochilli.rollingsky.GameApp"), "onCreate",  new XC_MethodHook() {
//                @Override
//                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
//                    LogUtils.d(Tag, "hook com.turbochilli.rollingsky");
//                    Context context = (Context) param.thisObject;
//                    ClassLoader classLoader = context.getClassLoader();
//                    hookForAdtiming(classLoader);
//                }
//            });
//        }

        //个推看护sdk
//        if(loadPackageParam.packageName.equals("")){ //com.jedigames.p16.lenovo
//            //hook Get报文
//            XposedHelpers.findAndHookMethod(loadPackageParam.classLoader.loadClass("com.sdk.plus.g.a"), "b", Map.class, new XC_MethodHook() {
//                @Override
//                protected void afterHookedMethod(MethodHookParam param) throws Throwable {
//                    Map map = (Map)param.args[0];
//                    LogUtils.d(Tag, "HTTP GET URL: " + XposedHelpers.getObjectField(XposedHelpers.getObjectField(param.thisObject, "a"), "a"));
//                    for(Object item : map.keySet()){
//                        LogUtils.d(Tag, "HTTP GET HEAD FIELD: key: " + item + " value: " + map.get(item));
//                    }
//                    LogUtils.d(Tag, "HTTP GET RESULT: " + new String((byte[])param.getResult()));
//                }
//            });
//
//            XposedHelpers.findAndHookMethod(loadPackageParam.classLoader.loadClass("com.sdk.plus.g.a"), "a", Map.class, new XC_MethodHook() {
//                @Override
//                protected void afterHookedMethod(MethodHookParam param) throws Throwable {
//                    Map map = (Map)param.args[0];
//                    LogUtils.d(Tag, "HTTP POST URL: " + XposedHelpers.getObjectField(XposedHelpers.getObjectField(param.thisObject, "a"), "a"));
//                    for(Object item : map.keySet()){
//                        LogUtils.d(Tag, "HTTP POST HEAD FIELD: key: " + item + " value: " + map.get(item));
//                    }
//                    LogUtils.d(Tag, "HTTP POST RESULT: " + new String((byte[])param.getResult()));
//                }
//            });
//
//            XposedHelpers.findAndHookMethod(loadPackageParam.classLoader.loadClass("com.sdk.plus.a.a.b"), "b", String.class, new XC_MethodHook() {
//                @Override
//                protected void afterHookedMethod(MethodHookParam param) throws Throwable {
//                    LogUtils.d(Tag, "databasea: " + param.getResult());
//                }
//            });
//        }


        //HillsmobiSDK-v8.0.3-其它
        if(loadPackageParam.packageName.equals("com.cleanmaster.mguard")){
            LogUtils.d(Tag, "11111111111");

            XposedHelpers.findAndHookMethod(loadPackageParam.classLoader.loadClass("com.keniu.security.main.MainActivity"), "onCreate", Bundle.class, new XC_MethodHook() {
                @Override
                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                    LogUtils.d(Tag, "aaaaaaaaaaaaaaaaa");
//                    new Thread(new Runnable() {
//                        @Override
//                        public void run() {
//                            try {
//                                LogUtils.d(Tag, "bbbbbbbbbbbbb");
//                                CommonUtils.sleep(30000);
//                                Object v1 = XposedHelpers.newInstance(loadPackageParam.classLoader.loadClass("com.hillsmobi.base.ʿ.ʼ"), 0);
//                                XposedHelpers.callMethod(v1, "ʻ", "com.tencent.mm");
//                                XposedHelpers.callStaticMethod(loadPackageParam.classLoader.loadClass("com.hillsmobi.base.thread.ThreadExecutorProxy"), "execute", v1);
//                            }catch (Exception e){
//                                e.printStackTrace();
//                            }
//                        }
//                    }).start();
                }
            });

            XposedHelpers.findAndHookMethod(loadPackageParam.classLoader.loadClass("com.hillsmobi.base.ad.redirect.HttpRedirect"), "request", new XC_MethodHook() {
                @Override
                protected void afterHookedMethod(MethodHookParam param) throws Throwable {
                    LogUtils.d(Tag, "url0: " + XposedHelpers.callMethod(XposedHelpers.callStaticMethod(
                            loadPackageParam.classLoader.loadClass("com.hillsmobi.base.ad.redirect.RedirectManager"), "getInstance"), "getHttpGet",
                            XposedHelpers.getObjectField(param.thisObject, "ʻ")));
                    LogUtils.d(Tag, "1: " + XposedHelpers.getObjectField(param.thisObject, "ʻ"));
                    LogUtils.d(Tag, "2: " + XposedHelpers.getObjectField(param.thisObject, "ʽ"));
                }
            });

            XposedHelpers.findAndHookMethod(loadPackageParam.classLoader.loadClass("com.hillsmobi.base.ad.redirect.RedirectTask"), "nextRedirect", String.class, new XC_MethodHook() {
                @Override
                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                    LogUtils.d(Tag, "nextRedirect: " + param.args[0]);
                }
            });
            XposedHelpers.findAndHookMethod(loadPackageParam.classLoader.loadClass("com.hillsmobi.base.ad.redirect.RedirectTask"), "redirectError", String.class, new XC_MethodHook() {
                @Override
                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                    LogUtils.d(Tag, "redirectError: " + param.args[0]);
                }
            });
            XposedHelpers.findAndHookMethod(loadPackageParam.classLoader.loadClass("com.hillsmobi.base.ad.redirect.RedirectTask"), "redirectSuccess", String.class, new XC_MethodHook() {
                @Override
                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                    LogUtils.d(Tag, "redirectSuccess: " + param.args[0]);
                }
            });

            XposedHelpers.findAndHookConstructor(URL.class, String.class, new XC_MethodHook() {
                @Override
                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                    String url = (String)param.args[0];
                    if(!url.contains("ksmobile") && !url.contains("app-measurement")){
                        LogUtils.d(Tag, "TOTAL URL: " + param.args[0]);
                    }
                }
            });

            XposedHelpers.findAndHookMethod(loadPackageParam.classLoader.loadClass("com.hillsmobi.base.http.HttpUtil"), "ʻ", new XC_MethodHook() {
                @Override
                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                    Object hookClass = XposedHelpers.getObjectField(param.thisObject, "ˆ");
                    if(hookClass != null){
                        XposedHelpers.findAndHookMethod(hookClass.getClass(), "onSuccess", int.class, String.class, new XC_MethodHook() {
                            @Override
                            protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                                LogUtils.d(Tag, "onSuccess: " + param.args[1]);
                            }
                        });
                    }
                }
            });

            XposedHelpers.findAndHookMethod(loadPackageParam.classLoader.loadClass("com.hillsmobi.base.http.HttpUtil"), "ʽ", new XC_MethodHook() {
                @Override
                protected void afterHookedMethod(MethodHookParam param) throws Throwable {
                    LogUtils.d(Tag, "SECOND URL: " + XposedHelpers.getObjectField(param.thisObject, "ʽ"));
                    LogUtils.d(Tag, "SECOND POSTDATA: " + XposedHelpers.getObjectField(param.thisObject, "ˎ"));
                }
            });

            XposedHelpers.findAndHookMethod(loadPackageParam.classLoader.loadClass("com.hillsmobi.base.ˈ.ʽ"), "ʻ", String.class, new XC_MethodHook() {
                @Override
                protected void afterHookedMethod(MethodHookParam param) throws Throwable {
                    LogUtils.d(Tag, "encrypt before: " + param.args[0]);
                    LogUtils.d(Tag, "encrypt after: " + param.getResult());
                }
            });

            XposedHelpers.findAndHookMethod(loadPackageParam.classLoader.loadClass("com.hillsmobi.base.ˈ.ʽ"), "ʼ", String.class, new XC_MethodHook() {
                @Override
                protected void afterHookedMethod(MethodHookParam param) throws Throwable {
                    LogUtils.d(Tag, "decrypt before: " + param.args[0]);
                    LogUtils.d(Tag, "decrypt after: " + param.getResult());

//                    Object tmpObj = XposedHelpers.callMethod(XposedHelpers.callStaticMethod(loadPackageParam.classLoader.loadClass("com.hillsmobi.base.ˆ.ʽ"), "ʻ"), "ʾ");
//                    LogUtils.d(Tag, "00: " + XposedHelpers.callMethod(tmpObj, "ᴵ"));
//                    LogUtils.d(Tag, "01: " + XposedHelpers.callMethod(tmpObj, "ᴵᴵ"));
//                    LogUtils.d(Tag, "03: " + XposedHelpers.callMethod(tmpObj, "ʻʻ"));
//                    LogUtils.d(Tag, "04: " + XposedHelpers.callMethod(tmpObj, "ᐧᐧ"));


//                    String result = (String)param.getResult();
//                    if(result.contains("cfg_prog")){
//                        JSONObject cfgJson = new JSONObject(result).optJSONObject("cfg_prog");
//                        LogUtils.d(Tag, "jkd: " + XposedHelpers.callStaticMethod(loadPackageParam.classLoader.loadClass("com.hillsmobi.base.ˈ.ʽ"), "ʼ", cfgJson.optString("jkd")));
//                        LogUtils.d(Tag, "jke: " + XposedHelpers.callStaticMethod(loadPackageParam.classLoader.loadClass("com.hillsmobi.base.ˈ.ʽ"), "ʼ", cfgJson.optString("jke")));
//                        LogUtils.d(Tag, "jkf: " + XposedHelpers.callStaticMethod(loadPackageParam.classLoader.loadClass("com.hillsmobi.base.ˈ.ʽ"), "ʼ", cfgJson.optString("jkf")));
//                        LogUtils.d(Tag, "jkg: " + XposedHelpers.callStaticMethod(loadPackageParam.classLoader.loadClass("com.hillsmobi.base.ˈ.ʽ"), "ʼ", cfgJson.optString("jkg")));
//                        LogUtils.d(Tag, "jkh: " + XposedHelpers.callStaticMethod(loadPackageParam.classLoader.loadClass("com.hillsmobi.base.ˈ.ʽ"), "ʼ", cfgJson.optString("jkh")));
//                        LogUtils.d(Tag, "jki: " + XposedHelpers.callStaticMethod(loadPackageParam.classLoader.loadClass("com.hillsmobi.base.ˈ.ʽ"), "ʼ", cfgJson.optString("jki")));
//                        LogUtils.d(Tag, "jkj: " + XposedHelpers.callStaticMethod(loadPackageParam.classLoader.loadClass("com.hillsmobi.base.ˈ.ʽ"), "ʼ", cfgJson.optString("jkj")));
//                        LogUtils.d(Tag, "jkk: " + XposedHelpers.callStaticMethod(loadPackageParam.classLoader.loadClass("com.hillsmobi.base.ˈ.ʽ"), "ʼ", cfgJson.optString("jkk")));
//                        LogUtils.d(Tag, "jkl: " + XposedHelpers.callStaticMethod(loadPackageParam.classLoader.loadClass("com.hillsmobi.base.ˈ.ʽ"), "ʼ", cfgJson.optString("jkl")));
//                        LogUtils.d(Tag, "jkm: " + XposedHelpers.callStaticMethod(loadPackageParam.classLoader.loadClass("com.hillsmobi.base.ˈ.ʽ"), "ʼ", cfgJson.optString("jkm")));
//                        LogUtils.d(Tag, "jkn: " + XposedHelpers.callStaticMethod(loadPackageParam.classLoader.loadClass("com.hillsmobi.base.ˈ.ʽ"), "ʼ", cfgJson.optString("jkn")));
//                        LogUtils.d(Tag, "jko: " + XposedHelpers.callStaticMethod(loadPackageParam.classLoader.loadClass("com.hillsmobi.base.ˈ.ʽ"), "ʼ", cfgJson.optString("jko")));
//                        LogUtils.d(Tag, "jkp: " + XposedHelpers.callStaticMethod(loadPackageParam.classLoader.loadClass("com.hillsmobi.base.ˈ.ʽ"), "ʼ", cfgJson.optString("jkp")));
//                        LogUtils.d(Tag, "jkq: " + XposedHelpers.callStaticMethod(loadPackageParam.classLoader.loadClass("com.hillsmobi.base.ˈ.ʽ"), "ʼ", cfgJson.optString("jkq")));
//                        LogUtils.d(Tag, "jkr: " + XposedHelpers.callStaticMethod(loadPackageParam.classLoader.loadClass("com.hillsmobi.base.ˈ.ʽ"), "ʼ", cfgJson.optString("jkr")));
//                        LogUtils.d(Tag, "jks: " + XposedHelpers.callStaticMethod(loadPackageParam.classLoader.loadClass("com.hillsmobi.base.ˈ.ʽ"), "ʼ", cfgJson.optString("jks")));
//                        LogUtils.d(Tag, "jkt: " + XposedHelpers.callStaticMethod(loadPackageParam.classLoader.loadClass("com.hillsmobi.base.ˈ.ʽ"), "ʼ", cfgJson.optString("jkt")));
//                        LogUtils.d(Tag, "jku: " + XposedHelpers.callStaticMethod(loadPackageParam.classLoader.loadClass("com.hillsmobi.base.ˈ.ʽ"), "ʼ", cfgJson.optString("jku")));
//                        LogUtils.d(Tag, "jkv: " + XposedHelpers.callStaticMethod(loadPackageParam.classLoader.loadClass("com.hillsmobi.base.ˈ.ʽ"), "ʼ", cfgJson.optString("jkv")));
//                        LogUtils.d(Tag, "jkw: " + XposedHelpers.callStaticMethod(loadPackageParam.classLoader.loadClass("com.hillsmobi.base.ˈ.ʽ"), "ʼ", cfgJson.optString("jkw")));
//                        LogUtils.d(Tag, "jkx: " + XposedHelpers.callStaticMethod(loadPackageParam.classLoader.loadClass("com.hillsmobi.base.ˈ.ʽ"), "ʼ", cfgJson.optString("jkx")));
//                        LogUtils.d(Tag, "jky: " + XposedHelpers.callStaticMethod(loadPackageParam.classLoader.loadClass("com.hillsmobi.base.ˈ.ʽ"), "ʼ", cfgJson.optString("jky")));
//                        LogUtils.d(Tag, "jkz: " + XposedHelpers.callStaticMethod(loadPackageParam.classLoader.loadClass("com.hillsmobi.base.ˈ.ʽ"), "ʼ", cfgJson.optString("jkz")));
//
//                        LogUtils.d(Tag, "jla: " + XposedHelpers.callStaticMethod(loadPackageParam.classLoader.loadClass("com.hillsmobi.base.ˈ.ʽ"), "ʼ", cfgJson.optString("jla")));
//                        LogUtils.d(Tag, "jlb: " + XposedHelpers.callStaticMethod(loadPackageParam.classLoader.loadClass("com.hillsmobi.base.ˈ.ʽ"), "ʼ", cfgJson.optString("jlb")));
//                        LogUtils.d(Tag, "jlc: " + XposedHelpers.callStaticMethod(loadPackageParam.classLoader.loadClass("com.hillsmobi.base.ˈ.ʽ"), "ʼ", cfgJson.optString("jlc")));
//                        LogUtils.d(Tag, "jld: " + XposedHelpers.callStaticMethod(loadPackageParam.classLoader.loadClass("com.hillsmobi.base.ˈ.ʽ"), "ʼ", cfgJson.optString("jld")));
//                        LogUtils.d(Tag, "jle: " + XposedHelpers.callStaticMethod(loadPackageParam.classLoader.loadClass("com.hillsmobi.base.ˈ.ʽ"), "ʼ", cfgJson.optString("jle")));
//                        LogUtils.d(Tag, "jlf: " + XposedHelpers.callStaticMethod(loadPackageParam.classLoader.loadClass("com.hillsmobi.base.ˈ.ʽ"), "ʼ", cfgJson.optString("jlf")));
//                        LogUtils.d(Tag, "jlg: " + XposedHelpers.callStaticMethod(loadPackageParam.classLoader.loadClass("com.hillsmobi.base.ˈ.ʽ"), "ʼ", cfgJson.optString("jlg")));
//                        LogUtils.d(Tag, "jlh: " + XposedHelpers.callStaticMethod(loadPackageParam.classLoader.loadClass("com.hillsmobi.base.ˈ.ʽ"), "ʼ", cfgJson.optString("jlh")));
//                        LogUtils.d(Tag, "jli: " + XposedHelpers.callStaticMethod(loadPackageParam.classLoader.loadClass("com.hillsmobi.base.ˈ.ʽ"), "ʼ", cfgJson.optString("jli")));
//                        LogUtils.d(Tag, "jlj: " + XposedHelpers.callStaticMethod(loadPackageParam.classLoader.loadClass("com.hillsmobi.base.ˈ.ʽ"), "ʼ", cfgJson.optString("jlj")));
//                        LogUtils.d(Tag, "jlk: " + XposedHelpers.callStaticMethod(loadPackageParam.classLoader.loadClass("com.hillsmobi.base.ˈ.ʽ"), "ʼ", cfgJson.optString("jlk")));
//                        LogUtils.d(Tag, "jll: " + XposedHelpers.callStaticMethod(loadPackageParam.classLoader.loadClass("com.hillsmobi.base.ˈ.ʽ"), "ʼ", cfgJson.optString("jll")));
//                        LogUtils.d(Tag, "jlm: " + XposedHelpers.callStaticMethod(loadPackageParam.classLoader.loadClass("com.hillsmobi.base.ˈ.ʽ"), "ʼ", cfgJson.optString("jlm")));
//                        LogUtils.d(Tag, "jln: " + XposedHelpers.callStaticMethod(loadPackageParam.classLoader.loadClass("com.hillsmobi.base.ˈ.ʽ"), "ʼ", cfgJson.optString("jln")));
//                        LogUtils.d(Tag, "jlo: " + XposedHelpers.callStaticMethod(loadPackageParam.classLoader.loadClass("com.hillsmobi.base.ˈ.ʽ"), "ʼ", cfgJson.optString("jlo")));
//                    }
//                    CommonUtils.printCallStatck();
                }
            });

            XposedHelpers.findAndHookMethod(loadPackageParam.classLoader.loadClass("com.hillsmobi.base.http.HttpUtil"), "ʿ", new XC_MethodHook() {
                @Override
                protected void afterHookedMethod(MethodHookParam param) throws Throwable {
                    LogUtils.d(Tag, "MID URL: " + XposedHelpers.getObjectField(param.thisObject, "ʽ"));
                }
            });

            XposedHelpers.findAndHookConstructor(loadPackageParam.classLoader.loadClass("com.hillsmobi.base.http.HttpUtil"), String.class,
                    loadPackageParam.classLoader.loadClass("com.hillsmobi.base.http.HttpUtil$RequestMethod"), new XC_MethodHook() {
                        @Override
                        protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                            LogUtils.d(Tag, "http0: " + param.args[0]);
                            LogUtils.d(Tag, "http0: " + param.args[1]);

                            LogUtils.d(Tag, "a: " + XposedHelpers.callStaticMethod(loadPackageParam.classLoader.loadClass("com.hillsmobi.base.ʻ.ʻ"), "ʻ"));
                            LogUtils.d(Tag, "b: " + XposedHelpers.callStaticMethod(loadPackageParam.classLoader.loadClass("com.hillsmobi.base.ʻ.ʻ"), "ʻ", ""));
                            LogUtils.d(Tag, "c: " + XposedHelpers.callStaticMethod(loadPackageParam.classLoader.loadClass("com.hillsmobi.base.ʻ.ʻ"), "ʼ"));
                            LogUtils.d(Tag, "d: " + XposedHelpers.callStaticMethod(loadPackageParam.classLoader.loadClass("com.hillsmobi.base.ʻ.ʻ"), "ʼ", ""));
                            LogUtils.d(Tag, "e: " + XposedHelpers.callStaticMethod(loadPackageParam.classLoader.loadClass("com.hillsmobi.base.ʻ.ʻ"), "ʽ"));
                            LogUtils.d(Tag, "f: " + XposedHelpers.callStaticMethod(loadPackageParam.classLoader.loadClass("com.hillsmobi.base.ʻ.ʻ"), "ʾ"));
                        }
                    });

            XposedHelpers.findAndHookMethod(loadPackageParam.classLoader.loadClass("com.hillsmobi.base.ˈ.ˆ$ʼ"), "ʻ", Context.class, String.class, new XC_MethodHook() {
                @Override
                protected void afterHookedMethod(MethodHookParam param) throws Throwable {
                    LogUtils.d(Tag, "system get: " + param.args[1] + " result: " + param.getResult());
                }
            });

            XposedHelpers.findAndHookMethod(loadPackageParam.classLoader.loadClass("com.hillsmobi.base.ˈ.ˆ"), "ʻ",
                    Class.class, String.class, Class[].class, new XC_MethodHook() {
                @Override
                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                    LogUtils.d(Tag, "class0: " + ((Class)param.args[0]).getName());
                    LogUtils.d(Tag, "Method0: " + param.args[1]);
                    Class[] args = (Class[])param.args[2];
                    if(args != null){
                        for(int i = 0; i < args.length; i++){
                            LogUtils.d(Tag, "i: " + args[i]);
                        }
                    }
                }
            });

//            XposedHelpers.findAndHookMethod(loadPackageParam.classLoader.loadClass("com.hillsmobi.base.imageloader.RequestCreator"), "ʽ",
//                    loadPackageParam.classLoader.loadClass("com.hillsmobi.base.imageloader.RequestCreator"), new XC_MethodHook() {
//                @Override
//                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
//                    LogUtils.d(Tag, "iamge URL: " + XposedHelpers.getObjectField(param.thisObject, "ʼ"));
//                }
//            });
            LogUtils.d(Tag, "2222222");
//            XposedHelpers.findAndHookMethod(loadPackageParam.classLoader.loadClass("com.hillsmobi.ʻ.ʻ.ʼ"), "ʻ", new XC_MethodHook() {
//                @Override
//                protected void afterHookedMethod(MethodHookParam param) throws Throwable {
//                    LogUtils.d(Tag, "First URL: " + XposedHelpers.getObjectField(param.thisObject, "ʻ"));
//                    LogUtils.d(Tag, "First UA: " + XposedHelpers.getObjectField(param.thisObject, "ʽ"));
//                }
//            });
//

//

//
//            XposedHelpers.findAndHookMethod(loadPackageParam.classLoader.loadClass("com.hillsmobi.ʻ.ˉ"), "ʻ", String.class, new XC_MethodHook() {
//                @Override
//                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
//                    LogUtils.d(Tag, "JSON： " + param.args[0]);
//                }
//            });
//
//            XposedHelpers.findAndHookMethod(loadPackageParam.classLoader.loadClass("com.hillsmobi.ʼ.ʻ$1"), "onReceive", Context.class, Intent.class, new XC_MethodHook() {
//                @Override
//                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
//                    Intent intent = (Intent) param.args[1];
//                    CommonUtils.printIntent(intent);
//                    Object a = XposedHelpers.callMethod(XposedHelpers.callStaticMethod(loadPackageParam.classLoader.loadClass("com.hillsmobi.ʻ.ˉ.ʽ"), "ʻ"), "ʾ");
//                    LogUtils.d(Tag, "class1: " + XposedHelpers.callMethod(a, "ᵎ"));
//                    LogUtils.d(Tag, "method1: " + XposedHelpers.callMethod(a, "ᴵᴵ"));
//                    LogUtils.d(Tag, "class2: " + XposedHelpers.callMethod(a, "ˑ"));
//                    LogUtils.d(Tag, "method2: " + XposedHelpers.callMethod(a, "ʻʻ"));
//                }
//            });
//
//            XposedHelpers.findAndHookMethod(loadPackageParam.classLoader.loadClass("com.hillsmobi.ʼ.ʻ$2"), "onChange", boolean.class, Uri.class, new XC_MethodHook() {
//                @Override
//                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
//                    Object a = XposedHelpers.callMethod(XposedHelpers.callStaticMethod(loadPackageParam.classLoader.loadClass("com.hillsmobi.ʻ.ˉ.ʽ"), "ʻ"), "ʾ");
//                    LogUtils.d(Tag, "00: " + param.args[0]);
//                    LogUtils.d(Tag, "01: " + param.args[1]);
//                }
//            });
        }
    }

    private void hookForAdtiming(ClassLoader classLoader){
        try{

            XposedHelpers.findAndHookMethod(classLoader.loadClass("com.aiming.mdt.sdk.util.IOUtil"), "copy", InputStream.class, OutputStream.class, new XC_MethodHook() {
                @Override
                protected void afterHookedMethod(MethodHookParam param) throws Throwable {
                    OutputStream inputStream = (OutputStream)param.args[1];
                    LogUtils.d(Tag, "resultll: " + inputStream.toString());
                }
            });

            XposedHelpers.findAndHookMethod(classLoader.loadClass("com.adt.a.cp"), "c", String.class, new XC_MethodHook() {
                @Override
                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                    LogUtils.d(Tag, "ccc: " + param.args[0]);
                }
            });

            XposedHelpers.findAndHookMethod(classLoader.loadClass("com.aiming.mdt.sdk.AdtAds"), "init", Context.class, String.class, classLoader.loadClass("com.aiming.mdt.sdk.Callback"), new XC_MethodHook() {
                @Override
                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                    LogUtils.d(Tag, "adtiming init");
                }
            });

            XposedHelpers.findAndHookMethod(classLoader.loadClass("com.adt.a.de"), "b", String.class, Throwable.class, new XC_MethodHook() {
                @Override
                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                    LogUtils.d(Tag, "b0: " + param.args[0]);
                    LogUtils.d(Tag, "b1: " + param.args[1]);
                }
            });

            XposedHelpers.findAndHookMethod(classLoader.loadClass("com.adt.a.de"), "d", String.class, new XC_MethodHook() {
                @Override
                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                    LogUtils.d(Tag, "d0: " + param.args[0]);
                }
            });

            XposedHelpers.findAndHookMethod(classLoader.loadClass("com.adt.a.de"), "e", String.class, String.class, new XC_MethodHook() {
                @Override
                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                    LogUtils.d(Tag, "e0: " + param.args[0]);
                    LogUtils.d(Tag, "e1: " + param.args[1]);
                }
            });

            XposedHelpers.findAndHookConstructor(URL.class, String.class, new XC_MethodHook() {
                @Override
                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                    String url = (String)param.args[0];
                    if(url.contains("adtiming")){
                        LogUtils.d(Tag, "URL: " + param.args[0]);
                    }
                }
            });

            XposedHelpers.findAndHookMethod(classLoader.loadClass("com.adt.a.ca"), "c", byte[].class, new XC_MethodHook() {
                @Override
                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                    byte[] post = (byte[])param.args[0];
                    LogUtils.d(Tag, "post: " + new String(post));
                }
            });

            XposedHelpers.findAndHookMethod(classLoader.loadClass("com.adt.a.dc"), "a", byte[].class, new XC_MethodHook() {
                @Override
                protected void afterHookedMethod(MethodHookParam param) throws Throwable {
                    LogUtils.d(Tag, "respose: " + param.getResult());
                }
            });
            XposedHelpers.findAndHookMethod(classLoader.loadClass("com.adt.a.dc"), "a", String.class, new XC_MethodHook() {
                @Override
                protected void afterHookedMethod(MethodHookParam param) throws Throwable {
                    LogUtils.d(Tag, "post111: " + param.args[0]);
                }
            });

            XposedHelpers.findAndHookMethod(classLoader.loadClass("com.adt.a.ct"), "b", byte[].class, new XC_MethodHook() {
                @Override
                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                    byte[] post = (byte[])param.args[0];
                    LogUtils.d(Tag, "post222: " + new String(post));
                }
            });
        }catch (Exception e){

        }
    }

    //lh 是突破列
    private void hookFlurry(ClassLoader classLoader){
        try{
            XposedHelpers.findAndHookMethod(classLoader.loadClass("com.flurry.android.FlurryAgent$Builder"), "build", Context.class, String.class, new XC_MethodHook() {
                @Override
                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                    LogUtils.d(Tag, "was call: " + param.args[1]);
                }
            });

            XposedHelpers.findAndHookMethod(classLoader.loadClass("com.flurry.sdk.lh"), "b", classLoader.loadClass("com.flurry.sdk.lh"), new XC_MethodHook() {
                @Override
                protected void afterHookedMethod(MethodHookParam param) throws Throwable {
                    LogUtils.d(Tag, "bClassName: " + param.getResult().getClass().getName());
                }
            });

            XposedHelpers.findAndHookMethod(classLoader.loadClass("com.flurry.sdk.ml"), "a", InputStream.class, new XC_MethodHook() {
                @Override
                protected void afterHookedMethod(MethodHookParam param) throws Throwable {
                    byte[] barray = (byte[])param.getResult();
                    LogUtils.d(Tag, "mla: " + new String(barray));
                }
            });

            XposedHelpers.findAndHookMethod(classLoader.loadClass("com.flurry.sdk.lr"), "a", InputStream.class, new XC_MethodHook() {
                @Override
                protected void afterHookedMethod(MethodHookParam param) throws Throwable {
                    LogUtils.d(Tag, "lr readObj: " + param.getResult());
                }
            });

            XposedHelpers.findAndHookMethod(classLoader.loadClass("com.flurry.sdk.lr"), "a", OutputStream.class, Object.class, new XC_MethodHook() {
                @Override
                protected void afterHookedMethod(MethodHookParam param) throws Throwable {
                    LogUtils.d(Tag, "write: " + param.args[1]);
                    byte[] array = (byte[])param.args[1];
                    LogUtils.d(Tag, "lr arrayStr: " + new String(array));
//                    printCallStatck();
                }
            });

            XposedHelpers.findAndHookMethod(classLoader.loadClass("com.flurry.sdk.lb"), "c", int.class, String.class, String.class, new XC_MethodHook() {
                @Override
                protected void afterHookedMethod(MethodHookParam param) throws Throwable {
//                    LogUtils.d(Tag, "log0: " + param.args[0]);
//                    LogUtils.d(Tag, "log1: " + param.args[1]);
//                    LogUtils.d(Tag, "log2: " + param.args[2]);
                }
            });

            XposedHelpers.findAndHookMethod(classLoader.loadClass("com.flurry.sdk.lb"), "a", int.class, String.class, String.class, new XC_MethodHook() {
                @Override
                protected void afterHookedMethod(MethodHookParam param) throws Throwable {
                    LogUtils.d(Tag, "log0: " + param.args[0]);
                    LogUtils.d(Tag, "log1: " + param.args[1]);
                    LogUtils.d(Tag, "log2: " + param.args[2]);
                }
            });

            XposedHelpers.findAndHookMethod(classLoader.loadClass("com.flurry.sdk.ku"), "a", Object.class, new XC_MethodHook() {
                @Override
                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                    LogUtils.d(Tag, "writeFile : " + param.args[0]);
//                    printCallStatck();
                }
            });

            XposedHelpers.findAndHookMethod(classLoader.loadClass("com.flurry.sdk.ln"), "b", byte[].class, String.class, String.class, new XC_MethodHook() {
                @Override
                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                    LogUtils.d(Tag, "writeFile00 : " + param.args[0]);
//                    printCallStatck();
                }
            });

            XposedHelpers.findAndHookMethod(DataOutputStream.class, "writeShort", int.class, new XC_MethodHook() {
                @Override
                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                    LogUtils.d(Tag, "writeShort: " + param.args[0]);
                }
            });


            XposedHelpers.findAndHookMethod(DataOutputStream.class, "writeLong", long.class, new XC_MethodHook() {
                @Override
                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                    LogUtils.d(Tag, "writeLong: " + param.args[0]);
                }
            });


            XposedHelpers.findAndHookMethod(DataOutputStream.class, "writeUTF", String.class, new XC_MethodHook() {
                @Override
                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                    LogUtils.d(Tag, "writeUTF: " + param.args[0]);
                }
            });


            XposedHelpers.findAndHookMethod(DataOutputStream.class, "writeByte", int.class, new XC_MethodHook() {
                @Override
                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                    LogUtils.d(Tag, "writeByte: " + param.args[0]);
                }
            });

            XposedHelpers.findAndHookMethod(DataOutputStream.class, "writeBoolean", boolean.class, new XC_MethodHook() {
                @Override
                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                    LogUtils.d(Tag, "writeBoolean: " + param.args[0]);
                }
            });

            XposedHelpers.findAndHookMethod(DataOutputStream.class, "writeShort", int.class, new XC_MethodHook() {
                @Override
                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                    LogUtils.d(Tag, "writeShort: " + param.args[0]);
                }
            });

            XposedHelpers.findAndHookMethod(classLoader.loadClass("com.flurry.sdk.lw"), "a", InputStream.class, new XC_MethodHook() {
                @Override
                protected void afterHookedMethod(MethodHookParam param) throws Throwable {
                    LogUtils.d(Tag, "lw readObj: " + param.getResult());
                }
            });

            XposedHelpers.findAndHookMethod(classLoader.loadClass("com.flurry.sdk.lw"), "a", OutputStream.class, Object.class, new XC_MethodHook() {
                @Override
                protected void afterHookedMethod(MethodHookParam param) throws Throwable {
                    LogUtils.d(Tag, "write: " + param.args[1]);
                    LogUtils.d(Tag, "lw arrayStr: " + param.args[1]);
                }
            });

            XposedHelpers.findAndHookMethod(classLoader.loadClass("com.flurry.sdk.lj"), "a", new XC_MethodHook() {
                @Override
                protected void afterHookedMethod(MethodHookParam param) throws Throwable {
                    LogUtils.d(Tag, "url： " + XposedHelpers.getObjectField(param.thisObject, "g"));
                }
            });


            XposedHelpers.findAndHookMethod(DataOutputStream.class, "write", byte[].class, new XC_MethodHook() {
                @Override
                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                    LogUtils.d(Tag, "write: " + param.args[0]);
                }
            });

            XposedHelpers.findAndHookMethod(classLoader.loadClass("com.flurry.sdk.lh"), "c", classLoader.loadClass("com.flurry.sdk.lh"), new XC_MethodHook() {
                @Override
                protected void afterHookedMethod(MethodHookParam param) throws Throwable {
//                    LogUtils.d(Tag, "cClassName: " + param.getResult().getClass().getName());
                }
            });
        }catch (Exception e){}
    }


    public static void printCallStatck() {
        Throwable ex = new Throwable();
        DexClassLoader dexClassLoader;
        StackTraceElement[] stackElements = ex.getStackTrace();
        if (stackElements != null) {
            for (int i = 0; i < stackElements.length; i++) {
                LogUtils.d(Tag, stackElements[i].getClassName());
//                Log.d(Tag, stackElements[i].getFileName());
                LogUtils.d(Tag, stackElements[i].getLineNumber() + "/t");
                LogUtils.d(Tag, stackElements[i].getMethodName());
                LogUtils.d(Tag, "-----------------------------------");
            }
        }
    }

    private void hookForAppWall(ClassLoader classLoader){
        try{
            XposedHelpers.findAndHookMethod(classLoader.loadClass("nativesdk.ad.common"), "a", Context.class, new XC_MethodHook() {
                @Override
                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                    LogUtils.d(Tag, "a0 was called");
                }
            });

            XposedHelpers.findAndHookMethod(classLoader.loadClass("nativesdk.ad.common"), "a", Context.class, String.class,
                    classLoader.loadClass("nativesdk.ad.common.IAdSdkListener"), new XC_MethodHook() {
                @Override
                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                    LogUtils.d(Tag, "a1 was called");
                }
            });

            XposedHelpers.findAndHookMethod(classLoader.loadClass("nativesdk.ad.common"), "a", Context.class, boolean.class, new XC_MethodHook() {
                @Override
                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                    LogUtils.d(Tag, "a2 was called");
                }
            });

            XposedHelpers.findAndHookMethod(classLoader.loadClass("nativesdk.ad.common"), "b", Context.class, new XC_MethodHook() {
                @Override
                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                    LogUtils.d(Tag, "b0 was called");
                }
            });
        }catch (Exception e){
            e.printStackTrace();
        }
    }

    private void hookForMyTarget(ClassLoader classLoader){
        try{
            XposedHelpers.findAndHookConstructor(classLoader.loadClass("com.my.target.nativeads.NativeAd"), int.class, Context.class, new XC_MethodHook() {
                @Override
                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                    LogUtils.d(Tag, "ads was load");
                }
            });

            XposedHelpers.findAndHookMethod(classLoader.loadClass("com.my.target.bc"), "E", String.class, new XC_MethodHook() {
                @Override
                protected void afterHookedMethod(MethodHookParam param) throws Throwable {
                    LogUtils.d(Tag, "strToCookie: " + param.args[0]);
                }
            });


            XposedHelpers.findAndHookMethod(classLoader.loadClass("com.my.target.at"), "b", String.class, Context.class, new XC_MethodHook() {
                @Override
                protected void afterHookedMethod(MethodHookParam param) throws Throwable {
                    LogUtils.d(Tag, "sendAd request: " + param.args[0]);
                    LogUtils.d(Tag, "sendAd response: " + param.getResult());
                }
            });

            XposedHelpers.findAndHookMethod(classLoader.loadClass("com.my.target.bc"), "a", HttpCookie.class, new XC_MethodHook() {
                @Override
                protected void afterHookedMethod(MethodHookParam param) throws Throwable {
                    LogUtils.d(Tag, "CookieToStr: " + param.getResult());
                }
            });

            XposedHelpers.findAndHookMethod(classLoader.loadClass("com.my.target.ax"), "a", HttpURLConnection.class, new XC_MethodHook() {
                @Override
                protected void afterHookedMethod(MethodHookParam param) throws Throwable {
                    LogUtils.d(Tag, "http0: " + param.getResult());
                }
            });

            XposedHelpers.findAndHookMethod(classLoader.loadClass("com.my.target.ax"), "g", String.class, Context.class, new XC_MethodHook() {
                @Override
                protected void afterHookedMethod(MethodHookParam param) throws Throwable {
                    LogUtils.d(Tag, "http send stat: " + param.args[0]);
                }
            });


            XposedHelpers.findAndHookMethod(classLoader.loadClass("com.my.target.g"), "a", String.class, new XC_MethodHook() {
                @Override
                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                    LogUtils.d(Tag, "alog: " + param.args[0]);
                }
            });


            XposedHelpers.findAndHookMethod(classLoader.loadClass("com.my.target.g"), "b", String.class, new XC_MethodHook() {
                @Override
                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                    LogUtils.d(Tag, "blog: " + param.args[0]);
                }
            });


            XposedHelpers.findAndHookMethod(classLoader.loadClass("com.my.target.g"), "c", String.class, new XC_MethodHook() {
                @Override
                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                    LogUtils.d(Tag, "clog: " + param.args[0]);
                }
            });
        }catch (Exception e){
            LogUtils.d(Tag, "aaaaaaaaaaaa");
            e.printStackTrace();
        }
    }

    private void hookForBuglyNetwork(ClassLoader classLoader){
        try{
            XposedHelpers.findAndHookConstructor(classLoader.loadClass("com.tencent.bugly.proguard.v"), Context.class,
                    int.class, int.class, byte[].class, String.class, String.class, classLoader.loadClass("com.tencent.bugly.proguard.t"),
                    boolean.class, int.class, int.class, boolean.class, Map.class, new XC_MethodHook() {
                        @Override
                        protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                            HashMap hashMap = (HashMap)param.args[11];
                            if(hashMap != null){
                                for(Object item : hashMap.keySet()){
                                    LogUtils.d(Tag, "key: " + item);
                                    LogUtils.d(Tag, "value: " + hashMap.get(item));
                                }
                            }
                            LogUtils.d(Tag, "bugly0: " + param.args[4]);
                            LogUtils.d(Tag, "bugly0: " + param.args[5]);
                        }
                    });

            XposedHelpers.findAndHookMethod(classLoader.loadClass("com.tencent.bugly.crashreport.crash.b"), "a", Context.class, classLoader.loadClass("com.tencent.bugly.crashreport.crash.CrashDetailBean"),
                    classLoader.loadClass("com.tencent.bugly.crashreport.common.info.a"), new XC_MethodHook() {
                        @Override
                        protected void afterHookedMethod(MethodHookParam param) throws Throwable {
                            Object akalObj = param.getResult();
                            LogUtils.d(Tag, "akObj****************start");
                            ArrayList<Object> AArray = (ArrayList<Object>) XposedHelpers.getObjectField(akalObj, "A");
                            if(AArray != null){
                                for(int i = 0; i < AArray.size(); i++){
                                    LogUtils.d(Tag, "Ad " + i + " " + AArray.get(i));
                                }
                            }
                            HashMap<Object,Object> BhashMap = (HashMap<Object, Object>) XposedHelpers.getObjectField(akalObj, "B");
                            if(BhashMap != null){
                                for(Object item : BhashMap.keySet()){
                                    LogUtils.d(Tag, "Bkey: " + item);
                                    LogUtils.d(Tag, "Bvalue: " + BhashMap.get(item));
                                }
                            }
                            HashMap<Object,Object> ChashMap = (HashMap<Object, Object>) XposedHelpers.getObjectField(akalObj, "C");
                            if(ChashMap != null){
                                for(Object item : ChashMap.keySet()){
                                    LogUtils.d(Tag, "Ckey: " + item);
                                    LogUtils.d(Tag, "Cvalue: " + ChashMap.get(item));
                                }
                            }
                            LogUtils.d(Tag, "a: " + XposedHelpers.getObjectField(akalObj, "a"));
                            LogUtils.d(Tag, "b: " + XposedHelpers.getObjectField(akalObj, "b"));
                            LogUtils.d(Tag, "c: " + XposedHelpers.getObjectField(akalObj, "c"));
                            LogUtils.d(Tag, "d: " + XposedHelpers.getObjectField(akalObj, "d"));
                            LogUtils.d(Tag, "e: " + XposedHelpers.getObjectField(akalObj, "e"));
                            LogUtils.d(Tag, "f: " + XposedHelpers.getObjectField(akalObj, "f"));
                            LogUtils.d(Tag, "g: " + XposedHelpers.getObjectField(akalObj, "g"));
                            HashMap<Object,Object> hhashMap = (HashMap<Object, Object>) XposedHelpers.getObjectField(akalObj, "h");
                            if(hhashMap != null){
                                for(Object item : hhashMap.keySet()){
                                    LogUtils.d(Tag, "hkey: " + item);
                                    LogUtils.d(Tag, "hvalue: " + hhashMap.get(item));
                                }
                            }
                            LogUtils.d(Tag, "i: " + XposedHelpers.getObjectField(akalObj, "i"));

                            LogUtils.d(Tag, "k: " + XposedHelpers.getObjectField(akalObj, "k"));
                            LogUtils.d(Tag, "l: " + XposedHelpers.getObjectField(akalObj, "l"));
                            LogUtils.d(Tag, "m: " + XposedHelpers.getObjectField(akalObj, "m"));

                            ArrayList<Object> oArray = (ArrayList<Object>) XposedHelpers.getObjectField(akalObj, "o");
                            if(oArray != null){
                                for(int i = 0; i < AArray.size(); i++){
                                    LogUtils.d(Tag, "o " + i + " " + oArray.get(i));
                                }
                            }

                            ArrayList<Object> pArray = (ArrayList<Object>) XposedHelpers.getObjectField(akalObj, "p");
                            if(pArray != null){
                                for(int i = 0; i < pArray.size(); i++){
                                    LogUtils.d(Tag, "p " + i + " " + pArray.get(i));
                                }
                            }

                            ArrayList<Object> qArray = (ArrayList<Object>) XposedHelpers.getObjectField(akalObj, "q");
                            if(qArray != null){
                                for(int i = 0; i < qArray.size(); i++){
                                    LogUtils.d(Tag, "q " + i + " " + qArray.get(i));
                                }
                            }

                            HashMap<Object,Object> rhashMap = (HashMap<Object, Object>) XposedHelpers.getObjectField(akalObj, "r");
                            if(rhashMap != null){
                                for(Object item : rhashMap.keySet()){
                                    LogUtils.d(Tag, "rkey: " + item);
                                    LogUtils.d(Tag, "rvalue: " + rhashMap.get(item));
                                }
                            }

                            HashMap<Object,Object> shashMap = (HashMap<Object, Object>) XposedHelpers.getObjectField(akalObj, "s");
                            if(shashMap != null){
                                for(Object item : shashMap.keySet()){
                                    LogUtils.d(Tag, "skey: " + item);
                                    LogUtils.d(Tag, "svalue: " + shashMap.get(item));
                                }
                            }

                            LogUtils.d(Tag, "t: " + XposedHelpers.getObjectField(akalObj, "t"));

                            LogUtils.d(Tag, "u: " + XposedHelpers.getObjectField(akalObj, "u"));

                            HashMap<Object,Object> vhashMap = (HashMap<Object, Object>) XposedHelpers.getObjectField(akalObj, "v");
                            if(vhashMap != null){
                                for(Object item : vhashMap.keySet()){
                                    LogUtils.d(Tag, "vkey: " + item);
                                    LogUtils.d(Tag, "vvalue: " + vhashMap.get(item));
                                }
                            }

                            ArrayList<Object> yArray = (ArrayList<Object>) XposedHelpers.getObjectField(akalObj, "y");
                            if(yArray != null){
                                for(int i = 0; i < yArray.size(); i++){
                                    LogUtils.d(Tag, "y " + i + " " + yArray.get(i));
                                }
                            }

                            ArrayList<Object> zArray = (ArrayList<Object>) XposedHelpers.getObjectField(akalObj, "z");
                            if(zArray != null){
                                for(int i = 0; i < zArray.size(); i++){
                                    LogUtils.d(Tag, "z " + i + " " + zArray.get(i));
                                }
                            }
                            LogUtils.d(Tag, "akObj****************end");
                        }
                    });

            XposedHelpers.findAndHookMethod(classLoader.loadClass("com.tencent.bugly.proguard.a"), "a", List.class, int.class, new XC_MethodHook() {
                @Override
                protected void afterHookedMethod(MethodHookParam param) throws Throwable {
                    Object arObj = param.getResult();
                    LogUtils.d(Tag, "arObj****************** start");
                    LogUtils.d(Tag, "a: " + XposedHelpers.getObjectField(arObj, "a"));
                    LogUtils.d(Tag, "b: " + XposedHelpers.getObjectField(arObj, "b"));
                    LogUtils.d(Tag, "c: " + XposedHelpers.getObjectField(arObj, "c"));
                    ArrayList<Object> dArray = (ArrayList<Object>) XposedHelpers.getObjectField(arObj, "d");
                    if(dArray != null){
                        for(int i = 0; i < dArray.size(); i++){
                            LogUtils.d(Tag, "d " + i + " " + dArray.get(i).getClass().getName());
                        }
                    }

                    HashMap<Object,Object> ehashMap = (HashMap<Object, Object>) XposedHelpers.getObjectField(arObj, "e");
                    if(ehashMap != null){
                        for(Object item : ehashMap.keySet()){
                            LogUtils.d(Tag, "ekey: " + item);
                            LogUtils.d(Tag, "evalue: " + ehashMap.get(item));
                        }
                    }

                    ArrayList<Object> fArray = (ArrayList<Object>) XposedHelpers.getObjectField(arObj, "f");
                    if(fArray != null){
                        for(int i = 0; i < fArray.size(); i++){
                            LogUtils.d(Tag, "f " + i + " " + fArray.get(i));
                        }
                    }

                    HashMap<Object,Object> ghashMap = (HashMap<Object, Object>) XposedHelpers.getObjectField(arObj, "g");
                    if(ghashMap != null){
                        for(Object item : ghashMap.keySet()){
                            LogUtils.d(Tag, "gkey: " + item);
                            LogUtils.d(Tag, "gvalue: " + ghashMap.get(item));
                        }
                    }
                    LogUtils.d(Tag, "arObj******************end");
                }
            });

            XposedHelpers.findAndHookMethod(classLoader.loadClass("com.tencent.bugly.proguard.a"), "a", Context.class, int.class, byte[].class, new XC_MethodHook() {
                @Override
                protected void afterHookedMethod(MethodHookParam param) throws Throwable {
                    Object amObj = param.getResult();
                    LogUtils.d(Tag, "common******************start");
                    LogUtils.d(Tag, "a: " + XposedHelpers.getObjectField(amObj, "a"));
                    LogUtils.d(Tag, "b: " + XposedHelpers.getObjectField(amObj, "b"));
                    LogUtils.d(Tag, "c: " + XposedHelpers.getObjectField(amObj, "c"));
                    LogUtils.d(Tag, "d: " + XposedHelpers.getObjectField(amObj, "d"));
                    LogUtils.d(Tag, "e: " + XposedHelpers.getObjectField(amObj, "e"));
                    LogUtils.d(Tag, "f: " + XposedHelpers.getObjectField(amObj, "f"));
                    LogUtils.d(Tag, "g: " + XposedHelpers.getObjectField(amObj, "g"));

                    LogUtils.d(Tag, "i: " + XposedHelpers.getObjectField(amObj, "i"));
                    LogUtils.d(Tag, "j: " + XposedHelpers.getObjectField(amObj, "j"));
                    HashMap kMap = (HashMap)XposedHelpers.getObjectField(amObj, "k");
                    if(kMap != null){
                        for(Object item : kMap.keySet()){
                            LogUtils.d(Tag, "kkey: " + item);
                            LogUtils.d(Tag, "kalue: " + kMap.get(item));
                        }
                    }
                    LogUtils.d(Tag, "l: " + XposedHelpers.getObjectField(amObj, "l"));
                    LogUtils.d(Tag, "m: " + XposedHelpers.getObjectField(amObj, "m"));
                    LogUtils.d(Tag, "n: " + XposedHelpers.getObjectField(amObj, "n"));
                    LogUtils.d(Tag, "o: " + XposedHelpers.getObjectField(amObj, "o"));
                    LogUtils.d(Tag, "p: " + XposedHelpers.getObjectField(amObj, "p"));
                    LogUtils.d(Tag, "q: " + XposedHelpers.getObjectField(amObj, "q"));
                    LogUtils.d(Tag, "r: " + XposedHelpers.getObjectField(amObj, "r"));
                    LogUtils.d(Tag, "s: " + XposedHelpers.getObjectField(amObj, "s"));
                    LogUtils.d(Tag, "t: " + XposedHelpers.getObjectField(amObj, "t"));
                    LogUtils.d(Tag, "u: " + XposedHelpers.getObjectField(amObj, "u"));
                    LogUtils.d(Tag, "v: " + XposedHelpers.getObjectField(amObj, "v"));
                    LogUtils.d(Tag, "w: " + XposedHelpers.getObjectField(amObj, "w"));
                    LogUtils.d(Tag, "x: " + XposedHelpers.getObjectField(amObj, "x"));

                    HashMap zMap = (HashMap)XposedHelpers.getObjectField(amObj, "z");
                    if(kMap != null){
                        for(Object item : zMap.keySet()){
                            LogUtils.d(Tag, "zkey: " + item);
                            LogUtils.d(Tag, "zvalue: " + zMap.get(item));
                        }
                    }
                    LogUtils.d(Tag, "common******************end");
                }
            });

            XposedHelpers.findAndHookMethod(classLoader.loadClass("com.tencent.bugly.proguard.a"), "a", Object.class, new XC_MethodHook() {
                @Override
                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
//
//                    LogUtils.d(Tag, "bstr: " + XposedHelpers.getObjectField(param.thisObject, "b"));
//                    LogUtils.d(Tag, "11111111111111");
//                    HashMap aMap = (HashMap) XposedHelpers.getObjectField(param.thisObject, "a");
//                    if (aMap != null) {
//                        for (Object item : aMap.keySet()) {
//                            LogUtils.d(Tag, "key: " + item);
//                            LogUtils.d(Tag, "value: " + aMap.get(item));
//                        }
//                    }
//
//                    LogUtils.d(Tag, "2222222222222222");
//                    HashMap dMap = (HashMap) XposedHelpers.getObjectField(param.thisObject, "d");
//                    if (dMap != null) {
//                        for (Object item : dMap.keySet()) {
//                            LogUtils.d(Tag, "key: " + item);
//                            LogUtils.d(Tag, "value: " + dMap.get(item));
//                        }
//                    }
//                    LogUtils.d(Tag, "3333333333333333");
//                    LogUtils.d(Tag, "buglyContent: " + param.args[0]);
//                    LogUtils.d(Tag, "buglyContent1: " + param.args[0].toString());
                }
            });

        }catch (Exception e){

        }
    }

    private void hookForVungleNetwork(ClassLoader classLoader){
        try{

            LogUtils.d(Tag, "hook start");
//            XposedHelpers.findAndHookConstructor(classLoader.loadClass("ks.cm.antivirus.ad.juhe.adapter.VungleInterstitialAdapter"), new XC_MethodHook() {
//                @Override
//                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
//                    LogUtils.d(Tag, "VungleInterstitialAdapter init");
//                }
//            });

            XposedHelpers.findAndHookMethod(classLoader.loadClass("com.vungle.warren.network.VungleApiClient"), "config", classLoader.loadClass("retrofit2.d"),
                    new XC_MethodHook() {
                        @Override
                        protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                            LogUtils.d(Tag, "this is test");
                        }
                    });

            XposedHelpers.findAndHookMethod(classLoader.loadClass("com.tonyodev.fetch.FetchCallRunnabl"), "run", new XC_MethodHook() {
                @Override
                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                    LogUtils.d(Tag, "tonyodev url: " +  XposedHelpers.getObjectField(XposedHelpers.getObjectField(param.thisObject, "request"), "getUrl"));
                }
            });

            XposedHelpers.findAndHookMethod(classLoader.loadClass("com.tonyodev.fetch.FetchCallRunnabl"), "inputToString", new XC_MethodHook() {
                @Override
                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                    LogUtils.d(Tag, "tonyodev result: " +  param.getResult());
                }
            });

            XposedHelpers.findAndHookMethod(classLoader.loadClass("com.moat.analytics.mobile.vng.q"), "a", String.class, new XC_MethodHook() {
                @Override
                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                    LogUtils.d(Tag, "mota url: " + param.args[0]);
                }
            });

            XposedHelpers.findAndHookMethod(classLoader.loadClass("com.moat.analytics.mobile.vng.q"), "a", InputStream.class, new XC_MethodHook() {
                @Override
                protected void afterHookedMethod(MethodHookParam param) throws Throwable {
                    LogUtils.d(Tag, "mota result: " + param.getResult());
                }
            });

            XposedHelpers.findAndHookMethod(classLoader.loadClass("com.vungle.warren.network.VungleApiClient"), "init",
                    Context.class, String.class, String.class, classLoader.loadClass("com.vungle.warren.Storage"), new XC_MethodHook() {
                        @Override
                        protected void afterHookedMethod(MethodHookParam param) throws Throwable {
                            LogUtils.d(Tag, "reflectName: " + XposedHelpers.getObjectField(param.thisObject, "api").getClass().getName());
                            XposedHelpers.findAndHookMethod((Class) XposedHelpers.getObjectField(param.thisObject, "api"), "config", String.class, JsonObject.class, new XC_MethodHook() {
                                @Override
                                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                                    LogUtils.d(Tag, "ua0: " + param.args[0]);
                                    LogUtils.d(Tag, "ua1: " + param.args[1]);
                                }
                            });
                        }
                    });

            LogUtils.d(Tag, "hook finish");
        }catch (Exception e){}
    }

    private void hookForFile(ClassLoader classLoader){
        try{
            XposedHelpers.findAndHookMethod(classLoader.loadClass("com.xsj.crasheye.util.Utils"), "a", String.class, String.class, new XC_MethodHook() {
                @Override
                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                    LogUtils.d(Tag, "write0: " + param.args[0]);
                    LogUtils.d(Tag, "write1: " + param.args[1]);
                }
            });
        }catch (Exception e){
            e.printStackTrace();
        }
    }

    private void hookForMain(ClassLoader classLoader){
        try{
            XposedHelpers.findAndHookMethod(classLoader.loadClass("com.cmcm.uangme.ui.MainActivity"), "onCreate", Bundle.class, new XC_MethodHook() {
                @Override
                protected void afterHookedMethod(MethodHookParam param) throws Throwable {
                    HttpURLConnection connection = null;
//                    try{
                    URL url = new URL("http://www.baidu.com");

                    LogUtils.d(Tag, "aaaaaaaaaaaa");

                    connection = (HttpURLConnection) url.openConnection();
                    connection.setRequestMethod("GET");
                    connection.setConnectTimeout(8000);
                    connection.setReadTimeout(8000);
                    LogUtils.d(Tag, "bbbbbbbbbbb");
                    InputStream in = connection.getInputStream();
                    //下面对获取到的输入流进行读取
                    BufferedReader bufr = new BufferedReader(new InputStreamReader(in));
                    StringBuilder response = new StringBuilder();
                    String line = null;
                    while ((line = bufr.readLine()) != null) {
                        response.append(line);
                    }
                    LogUtils.d(Tag, "ccccccccc");
//                    }catch(Exception e){
//                        e.printStackTrace();
//                    }

//                    CommonUtils.sleep(100000);
//                    new Thread(new Runnable() {
//                        @Override
//                        public void run() {
//                            CommonUtils.sleep(60000);
//                            throw new RuntimeException("click exception...");
////                            String abc = null;
////                            if(abc.equals("")){
////                                LogUtils.d(Tag, "aaaaaaa");
////                            }
//                        }
//                    }).start();
                }
            });
        }catch (Exception e){
            e.printStackTrace();
        }
    }

    private void hookForCrashEye(final ClassLoader classLoader){
        try{
            XposedHelpers.findAndHookMethod(classLoader.loadClass("com.xsj.crasheye.NetSender"), "a", String.class, String.class, boolean.class, boolean.class, new XC_MethodHook() {
                @Override
                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                    LogUtils.d(Tag, "s0: " + param.args[0]);
                    LogUtils.d(Tag, "s1: " + param.args[1]);
                    String file0 = (String)XposedHelpers.callStaticMethod(classLoader.loadClass("com.xsj.crasheye.CrasheyeFileFilter"), "a");
                    String file1 = (String)XposedHelpers.callStaticMethod(classLoader.loadClass("com.xsj.crasheye.CrasheyeFileFilter"), "b");
                    LogUtils.d(Tag, "file0: " + file0);
                    if(new File(file0).exists()){
                        LogUtils.d(Tag, "file0content: " + CommonUtils.readStringFromFile(file0));
                    }else{
                        LogUtils.d(Tag, "file0 not exist");
                    }
                    LogUtils.d(Tag, "file1: " + file1);
                    if(new File(file1).exists()){
                        LogUtils.d(Tag, "file1content: " + CommonUtils.readStringFromFile(file1));
                    }else{
                        LogUtils.d(Tag, "file1 not exist");
                    }
                }
            });

            XposedHelpers.findAndHookMethod(classLoader.loadClass("com.xsj.crasheye.CrasheyeUrls"), "a", classLoader.loadClass("com.xsj.crasheye.EnumActionType"), String.class, new XC_MethodHook() {
                @Override
                protected void afterHookedMethod(MethodHookParam param) throws Throwable {
                    LogUtils.d(Tag, "00: " + param.args[0]);
                    LogUtils.d(Tag, "00: " + param.args[1]);
                    LogUtils.d(Tag, "0url: " + param.getResult());
                }
            });

            XposedHelpers.findAndHookMethod(classLoader.loadClass("com.xsj.crasheye.CrasheyeUrls"), "a", classLoader.loadClass("com.xsj.crasheye.EnumActionType"), byte[].class, new XC_MethodHook() {
                @Override
                protected void afterHookedMethod(MethodHookParam param) throws Throwable {
                    LogUtils.d(Tag, "10: " + param.args[0]);
                    LogUtils.d(Tag, "10: " + param.args[1]);
                    LogUtils.d(Tag, "1url: " + param.getResult());
                }
            });
        }catch (Exception e){}
    }

    private void hookForTest(ClassLoader classLoader){
        try{
            XposedHelpers.findAndHookMethod(classLoader.loadClass("com.umeng.commonsdk.UMConfigure"), "init", Context.class, String.class,
                    String.class, int.class, String.class, new XC_MethodHook() {
                        @Override
                        protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                            LogUtils.d(Tag, "init1: " + param.args[1]);
                            LogUtils.d(Tag, "init2: " + param.args[2]);
                            LogUtils.d(Tag, "init3: " + param.args[3]);
                            LogUtils.d(Tag, "init4: " + param.args[4]);
                        }
                    });

            XposedHelpers.findAndHookMethod(classLoader.loadClass("com.umeng.commonsdk.stateless.UMSLEnvelopeBuild"), "buildSLEnvelope", Context.class, JSONObject.class, JSONObject.class, String.class, new XC_MethodHook() {
                @Override
                protected void afterHookedMethod(MethodHookParam param) throws Throwable {
                    LogUtils.d(Tag, "json1: " + param.args[1]);
                    LogUtils.d(Tag, "json2: " + param.args[2]);
                    LogUtils.d(Tag, "json3: " + param.args[3]);
                    LogUtils.d(Tag, "jsonr: " + param.getResult());
                }
            });

            XposedHelpers.findAndHookMethod(classLoader.loadClass("com.umeng.commonsdk.proguard.u"), "a", classLoader.loadClass("com.umeng.commonsdk.proguard.l"),
                    new XC_MethodHook() {
                        @Override
                        protected void afterHookedMethod(MethodHookParam param) throws Throwable {
                            byte[] result = (byte[])param.getResult();
                            LogUtils.d(Tag, "id_trac: " + new String(result));
                        }
                    });

            XposedHelpers.findAndHookMethod(classLoader.loadClass("com.umeng.commonsdk.statistics.idtracking.e"), "a",
                    classLoader.loadClass("com.umeng.commonsdk.statistics.idtracking.a"), new XC_MethodHook() {
                        @Override
                        protected void afterHookedMethod(MethodHookParam param) throws Throwable {
                            LogUtils.d(Tag, "str: " + XposedHelpers.getObjectField(param.args[0], "a"));
                            LogUtils.d(Tag, "fstr: " + XposedHelpers.callMethod(param.args[0], "f"));
                        }
                    });


            XposedHelpers.findAndHookMethod(classLoader.loadClass("com.umeng.commonsdk.framework.b"), "a", String.class, new XC_MethodHook() {
                @Override
                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                    String filePath = (String)param.args[0];
                    LogUtils.d(Tag, "FilePath: " + filePath);
//                    LogUtils.d(Tag, "FileContent: " + new String(getContent(filePath)));
                }
            });

            XposedHelpers.findAndHookMethod(classLoader.loadClass("com.umeng.commonsdk.statistics.internal.c"), "a", byte[].class, String.class, new XC_MethodHook() {
                @Override
                protected void afterHookedMethod(MethodHookParam param) throws Throwable {
                    LogUtils.d(Tag, "send0: " + param.args[1]);
                }
            });

            XposedHelpers.findAndHookMethod(classLoader.loadClass("com.umeng.commonsdk.statistics.common.MLog"), "i", String.class, new XC_MethodHook() {
                @Override
                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                    LogUtils.d(Tag, "result: " + param.args[0]);
                }
            });


            XposedHelpers.findAndHookMethod(classLoader.loadClass("com.umeng.analytics.pro.g"), "a", String.class, new XC_MethodHook() {
                @Override
                protected void afterHookedMethod(MethodHookParam param) throws Throwable {
                    LogUtils.d(Tag, "00: " + param.args[0]);
                    LogUtils.d(Tag, "01: " + param.getResult());
                }
            });

//            XposedHelpers.findAndHookMethod(classLoader.loadClass("com.umeng.analytics.pro.j"), "a", Object.class, int.class, new XC_MethodHook() {
//                @Override
//                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
//                    LogUtils.d(Tag, "event0: " + param.args[0]);
//                    LogUtils.d(Tag, "event1: " + param.args[1]);
//
//                }
//            });
//
//            XposedHelpers.findAndHookMethod(classLoader.loadClass("com.umeng.analytics.CoreProtocol"), "setupReportData", long.class, new XC_MethodHook() {
//                @Override
//                protected void afterHookedMethod(MethodHookParam param) throws Throwable {
//                    LogUtils.d(Tag, "set0: " + param.args[0]);
//                    LogUtils.d(Tag, "setr: " + param.getResult());
//                }
//            });
//
//            XposedHelpers.findAndHookMethod(classLoader.loadClass("com.umeng.analytics.CoreProtocol"), "removeCacheData", Object.class, new XC_MethodHook() {
//                @Override
//                protected void afterHookedMethod(MethodHookParam param) throws Throwable {
//                    LogUtils.d(Tag, "removeCacheData: " + param.args[0]);
//                }
//            });

        }catch (Exception e){
            e.printStackTrace();
        }
    }

    public byte[] getContent(String filePath) throws IOException {
        File file = new File(filePath);
        long fileSize = file.length();
        if (fileSize > Integer.MAX_VALUE) {
            System.out.println("file too big...");
            return null;
        }
        FileInputStream fi = new FileInputStream(file);
        byte[] buffer = new byte[(int) fileSize];
        int offset = 0;
        int numRead = 0;
        while (offset < buffer.length
                && (numRead = fi.read(buffer, offset, buffer.length - offset)) >= 0) {
            offset += numRead;
        }
        // 确保所有数据均被读取
        if (offset != buffer.length) {
            throw new IOException("Could not completely read file "
                    + file.getName());
        }
        fi.close();
        return buffer;
    }

    private boolean isMainProcess(Context context, String processName){
        int pid = Process.myPid();
        Iterator iterator = ((ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE)).getRunningAppProcesses().iterator();
        while (iterator.hasNext()) {
            ActivityManager.RunningAppProcessInfo rapInfo = (ActivityManager.RunningAppProcessInfo) iterator.next();
            if(rapInfo.pid == pid && rapInfo.processName.equals(processName)){
                return true;
            }else if(rapInfo.pid != pid && rapInfo.processName.equals(processName)){
//                Process.killProcess(rapInfo.pid);
            }
        }
        return false;
    }
}